package com.xxx.video.main.adapters;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.xxx.video.R;
import com.xxx.video.commen.adapters.BaseRecycleViewAdapter;
import com.xxx.video.commen.adapters.BaseViewHolder;

import butterknife.BindView;
import butterknife.OnClick;

public class HomeHotTypeListAdapter2 extends BaseRecycleViewAdapter<Object, HomeHotTypeListAdapter2.MyHolder> {


    public HomeHotTypeListAdapter2(@NonNull Context context) {
        super(context);
    }

    @Override
    public MyHolder onCreateDefaultViewHolder(View view, int viewType) {
        return new MyHolder(view);
    }

    @Override
    public int getItemLayout(int viewType) {
        return R.layout.item_home_hot_fragment_type_list2;
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    @Override
    public boolean isSetBaseItemViewClickListener() {
        return false;
    }

    class MyHolder extends BaseViewHolder {
        @BindView(R.id.tv_item_home_hot_fragment_type_ranking)
        TextView tvItemHomeHotFragmentTypeRanking;
        @BindView(R.id.tv_item_home_hot_fragment_type_week)
        TextView tvItemHomeHotFragmentTypeWeek;
        @BindView(R.id.tv_item_home_hot_fragment_type_day)
        TextView tvItemHomeHotFragmentTypeDay;

        public MyHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void setData2View(int position) {

        }

        @OnClick({R.id.tv_item_home_hot_fragment_type_ranking, R.id.tv_item_home_hot_fragment_type_week, R.id.tv_item_home_hot_fragment_type_day})
        public void onViewClicked(View view) {
            switch (view.getId()) {
                case R.id.tv_item_home_hot_fragment_type_ranking:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 2);
                    }
                    break;
                case R.id.tv_item_home_hot_fragment_type_week:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 1);
                    }
                    break;
                case R.id.tv_item_home_hot_fragment_type_day:
                    if (onItemClickListener != null) {
                        onItemClickListener.onItemClick(null, 0, 0);
                    }
                    break;
                default:
                    break;
            }
        }

    }
}
